/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg_entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Oswaldo
 */
@Entity
@Table(name = "scar_caracter", catalog = "sisventas_db", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Caracter.findAll", query = "SELECT c FROM Caracter c"),
    @NamedQuery(name = "Caracter.findByCarCodigo", query = "SELECT c FROM Caracter c WHERE c.carCodigo = :carCodigo")})
public class Caracter implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "car_codigo")
    private Integer carCodigo;
    @JoinColumn(name = "tca_codigo", referencedColumnName = "tca_codigo")
    @ManyToOne
    private Tipcaract tcaCodigo;
    @JoinColumn(name = "aos_codigo", referencedColumnName = "aos_codigo")
    @ManyToOne
    private Artiserv aosCodigo;

    public Caracter() {
    }

    public Caracter(Integer carCodigo) {
        this.carCodigo = carCodigo;
    }

    public Integer getCarCodigo() {
        return carCodigo;
    }

    public void setCarCodigo(Integer carCodigo) {
        this.carCodigo = carCodigo;
    }

    public Tipcaract getTcaCodigo() {
        return tcaCodigo;
    }

    public void setTcaCodigo(Tipcaract tcaCodigo) {
        this.tcaCodigo = tcaCodigo;
    }

    public Artiserv getAosCodigo() {
        return aosCodigo;
    }

    public void setAosCodigo(Artiserv aosCodigo) {
        this.aosCodigo = aosCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (carCodigo != null ? carCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Caracter)) {
            return false;
        }
        Caracter other = (Caracter) object;
        if ((this.carCodigo == null && other.carCodigo != null) || (this.carCodigo != null && !this.carCodigo.equals(other.carCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pkg_entidades.Caracter[ carCodigo=" + carCodigo + " ]";
    }
    
}
